PROJECT='ProjectReport_new'

CLEAN_FILES=$(PROJECT).aux $(PROJECT).blg $(PROJECT).idx $(PROJECT).ind $(PROJECT).lof $(PROJECT).out $(PROJECT).toc *.bbl *.log

CLEAN_ALL_FILES=$(PROJECT).pdf $(PROJECT).dvi

LATEX=pdflatex
PDFLATEX=pdflatex
MAKEINDEX=makeindex
BIBTEX=bibtex
DVIPS=dvips
VIEWPDF=evince
SHELL=/bin/bash

CWD=basename `pwd`

all: index bibtex latex dvips pdflatex viewpdf

dvips:
	#$(DVIPS) $(PROJECT).dvi

pdflatex:
	$(PDFLATEX) $(PROJECT).tex

index:
	#$(LATEX) --src-specials $(PROJECT).tex
	#$(MAKEINDEX) <$(PROJECT).idx >$(PROJECT).ind

bibtex:
	$(LATEX) --src-specials $(PROJECT).tex
	$(BIBTEX) $(PROJECT)

latex:
	$(LATEX) --src-specials $(PROJECT).tex

viewpdf:
	$(VIEWPDF) $(PROJECT).pdf &

clean:
	-rm $(CLEAN_FILES) 2>/dev/null

clean-all: clean
	-rm $(CLEAN_ALL_FILES) 2>/dev/null

gzip: clean-all
	cd ..
	tar chof - $(CWD) | gzip -c9 > ~/Desktop/Report.tar.gz
